package org.rabbit.config;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate.ConfirmCallback;
import org.springframework.amqp.rabbit.core.RabbitTemplate.ReturnCallback;
import org.springframework.stereotype.Component;

@Component
public class UserRabbitMqConfirm implements ConfirmCallback,ReturnCallback{

	/**
	 * 消息成功投递到交换机回调
	 */
	@Override
	public void confirm(CorrelationData arg0, boolean arg1, String arg2) {
		System.out.println("send to exchage ok........");
	}
	
	/**
	 * 消息投递到队列失败的回调
	 */
	
	@Override
	public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) {
		System.out.println("send to queue failed"+replyText);
	}
}
